package com.ysd.resourceusestatistics.task;

import javax.annotation.Resource;

import com.ysd.resourceusestatistics.dao.IStatisticsDao;

import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
@EnableScheduling//定时任务
public class StatisticsTask {
@Resource
private IStatisticsDao statisticsDao;
//每天0点执行一次
@Scheduled(cron = "0 0 0 */1 * ?")
public void autoStatistics(){

    statisticsDao.autoStatistics();
}
}